function [list, config] = getPostureConfig( imSkel )


    %Config 
    %  0 - Unknonw
    % 1 = no loop
    % 2 - delta
    % 3 - alpha
    % 4 omega

    config = 0; %unknown';
    list = [];
    %Get the number of endpoints
    endpoints = bwmorph(imSkel, 'endpoints');
    [row ,col]  = find(endpoints);
    endpoint = [row,col];
    numEnds = size(endpoint, 1);

    %Get the number of branchpoints
    branchpoints = bwmorph(imSkel, 'branchpoints');
    [row ,col]  = find(branchpoints);
    branchpoint = [row,col];
    numBranches = size(branchpoint,1);

    if numBranches == 0 && numEnds == 2
        config = 1; %'noloop';
    elseif numEnds == 1
        config = 2; %delta
    elseif numBranches == 2 && numEnds == 2
        % Identify segment 1 and segment 2  
           usedSegments = [];
            for k = 1:length(segments)
                pixelList = segments(k).PixelList;

                %Segment 1 is associated with endpoint 1
                if ~isempty(find(ismember(endpoint1,pixelList,'rows')))
                    segment1 = pixelList;
                    usedSegments = [usedSegments,k];

                 %Segment2 is associated with endpoint 2
                elseif  ~isempty(find(ismember(endpoint2,pixelList,'rows')))
                    segment2 = pixelList;
                    usedSegments = [usedSegments,k];
                else
                    %do nothing
                end
            end
    
            %% Determine configuration - omega or alpha

            %Determine which configuration by determining whether segment 1 and 2
            %connect to the same branchpoint
            if (    isequal( ismember(branchpoint(1,:), segment1),[1])...
                  && isequal(ismember(branchpoint(1,:), segment2),[1]))...
                    ||...
                (    isequal(ismember(branchpoint(2,:), segment1),[1])...
                  && isequal(ismember(branchpoint(2,:), segment2),[1]) )

                config =4; % 'omega';
            else
                config = 3; %'alpha';
            end
    end
    
        
    

    
                
        
        
